/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.put.netbeans.dcs_modeler.actions;

/**
 *
 * @author rudy
 */
import java.util.logging.Logger;
import org.openide.cookies.CloseCookie;
import org.openide.cookies.OpenCookie;
import org.openide.loaders.OpenSupport;
import org.openide.windows.CloneableTopComponent;
import org.put.netbeans.dcs_modeler.ModelerMainWindowTopComponent;
import org.put.netbeans.dcs_modeler.dataObjects.DCSModelDefinitionDataObject;

public class DCSModelerOpenSuport extends OpenSupport implements OpenCookie, CloseCookie
{
    private static Logger log =
            Logger.getLogger( DCSModelerOpenSuport.class.getName() );

    public DCSModelerOpenSuport( DCSModelDefinitionDataObject.Entry entry )
    {
        super( entry );
    }
    
    @Override
    protected CloneableTopComponent createCloneableTopComponent()
    {
        DCSModelDefinitionDataObject dataObj = ( DCSModelDefinitionDataObject )entry.getDataObject();
        ModelerMainWindowTopComponent topComponent = new ModelerMainWindowTopComponent();
        topComponent.setDisplayName( dataObj.getName() );
        return topComponent;
    }
}
